﻿<%@ Page Language="C#" MasterPageFile="~/WebSite.Master"  AutoEventWireup="true" CodeBehind="PersonEmpListShow.aspx.cs" Inherits="RN.ERP.Web.Person.PersonEmpListShow" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript">
        var optType;
        var message;

        function CheckSel() {
            var chk = $("input:checked");
            if (chk.length == 0) {
                OpenAlert("请选择要操作的项！");
                return false;
            }
            return true;
        }
        function GetCheckVal() {
            var empGuid = "";
            $("input:checked").each(function () {
                empGuid += "," + $(this).val();
            });
            if (empGuid.length > 1) {
                empGuid = empGuid.substring(1);
            }
            return empGuid;
        }
        
        
        function confirmCallBackFnPost(arg) {
            if (arg) {
                var empGuid = GetCheckVal();
                var corpGuid = "<%=CorpUserGuid %>";
                var areaCode = "<%=AreaCode %>";
                if (empGuid == "") {
                    OpenAlert("请选择要操作的项！");
                    return false;
                }
                var parmer = {};
                parmer.action = "EmpPost";
                parmer.empGuid = empGuid;
                parmer.corpGuid = corpGuid;
                parmer.areaCode = areaCode;
                parmer.message = message;
                parmer.optType = optType;
                parmer.descr = "";
                parmer.rand = Math.random();
                $.getJSON("../Handlers/PsnEmpInfoHandler.ashx", parmer, function (data) {
                    if (data.Result) {
                        refreshGrid();
                    }
                    else {
                        //未上传的图片提示
                        if (data.Message == "img") {
                            OpenAlert(data.ReturnValue);
                            return false;
                        }
                    }
                    OpenAlert(data.Message);
                });
            }
        }
        /*查看人员*/
        function CheckView() {
            if (!CheckEdit()) {
                return false;
            }
            var empGuid = GetCheckVal();
            ShowViewForm(empGuid, 1);
            // window.location.href = "PersonEmpInfo.aspx?empGuid=" + empGuid + "&typeFlag=-1"; 
        }
     
        /*删除人员*/
        function CheckEmpDel() {
            if (!CheckSel()) {
                return false;
            }
            OpenConfirm('您确定要删除此信息？删除人员后会将人所在的证书全部删除，请谨慎操作！', confirmCallBackFn);
            return false;
        }
        function confirmCallBackFn(arg) {
            if (arg) {
                var empGuid = GetCheckVal();
                if (empGuid == "") {
                    OpenAlert("请选择要操作的项！");
                    return false;
                }
                $.getJSON("../Handlers/PsnEmpInfoHandler.ashx", { "action": "empDels", "empGuid": empGuid, "rand": Math.random() }, function (data) {
                    OpenAlert(data.Message);
                    refreshGrid();
                });
            }
        }

        /*刷新*/
        function refreshGrid() {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
        }
        function OpenAlert(text) {
            $.ligerDialog.warn(text);
            return false;
        }
        function OpenAlertFn(text, CallBackFn) {
            $.ligerDialog.warn(text, '', CallBackFn);
            return false;
        }
        function OpenConfirm(text, confirmCallBackFn) {
            $.ligerDialog.confirm(text, '', confirmCallBackFn);
            return false;
        }
        /*打开窗口*/
        function ShowViewForm(empGuid1, classId, flowCode) {
            var rType = "<%=RoleType %>";
            var opt = 1;
            if (rType == "User") {
                opt = 2;
            }
            top.ChildDialog = top.$.ligerDialog.open({ url: "Person/PersonEmpView.aspx?empGuid=" + empGuid1 + "&typeFlag=-1&opt=" + opt + "&ClassID=" + classId + "&FlowCode=" + flowCode, width: 1080, height: 800, title: '', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
            //top.setChildDialogClose(this, "OnClientCloseAudit");
            top.ChildDialogWin = this;
            return false;
        }
        
       
        /*操作刷新列表*/
        function OnClientCloseAudit(args) {
            refreshGrid();
            
            return false;
        }

        function ViewRepeatList(idCard) {
            var urlStr = "Person/PersonEmpRepeatList.aspx?idCard=" + idCard;
            top.ChildDialogWin = window;
            top.ChildDialog = top.$.ligerDialog.open({ url: urlStr, width: 1000, height: 700, title: '', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
            top.setChildDialogClose(this, "RefreshGrid");
        }

        
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <input id="hdSearchEndStr" type="hidden" runat="server" value="" />
    <input id="hdClassId" type="hidden" runat="server" value="" />
     <input id="hdEmpItemType" type="hidden" runat="server" value="" />
     <input id="hdEmpItemFlag" type="hidden" runat="server" value="0" />
       <input id="hdEmpAreaCode" type="hidden" runat="server" value="" />
         <input id="hdCorpUserGuid" type="hidden" runat="server" value="" />
           <input id="hdOtherAreaCode" type="hidden" runat="server" value="0" />
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="table-layout:fixed;margin-top:5px;">
        
        <tr>
            <td class="xx_m  tt_xx_l"></td>
            <td class="xx_m  tt_xx_icon"></td>
            <td style="width:auto;" class="xx_m">全部人员列表</td>
            <td style="width:14px;"><img src="../images/xx_r.jpg" width="14" height="33" /></td>
        </tr>
        <tr>
            <td class="left_con">
                &nbsp;
            </td>
            <td colspan="2" style="padding-left: 6px; padding-right: 6px;" valign="top">
                <!--#订单列表-->
                <div class="xian">
                    <div class="about_title">
                        全部人员列表</div>
                    <div class="i-con-cn">
                        <div id="UserDiv" runat="server" visible="false">
                            <%--<asp:LinkButton ID="btnDelPerson" runat="server" CssClass="xtbiao" OnClientClick="return CheckEmpDel();">删除人员</asp:LinkButton>--%>
                        </div>
                        <asp:LinkButton ID="lbtnEmpSreach" runat="server" CssClass="xtbiao" OnClick="lbtnEmpSreach_Click">查 询</asp:LinkButton>
                    </div>
                </div>
                <div style="padding-bottom: 5px; background-color: #eaeaea; width: 100%; padding-top: 5px;
                    margin-bottom: 10px;">
                    <table>
                        <tr>
                            <td align="center" style="width: 40px;">
                                姓名
                            </td>
                            <td>
                                <asp:TextBox ID="txtEmpName" runat="server" MaxLength="10" Width="100px" CssClass="text_css"></asp:TextBox>
                            </td>
                            <td style="width: 50px;" align="center">
                                身份证
                            </td>
                            <td>
                                <asp:TextBox ID="txtEmpIdCard" runat="server" MaxLength="30" CssClass="text_css"
                                    Width="150px"></asp:TextBox>
                            </td>
                            
                        </tr>
                    </table>
                </div>
                <div style="width:100%">
                    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                        <AjaxSettings>
                            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                                <UpdatedControls>
                                    <telerik:AjaxUpdatedControl ControlID="rgPersonList" LoadingPanelID="gridLoadingPanel">
                                    </telerik:AjaxUpdatedControl>
                                </UpdatedControls>
                            </telerik:AjaxSetting>
                            <telerik:AjaxSetting AjaxControlID="rgPersonList">
                                <UpdatedControls>
                                    <telerik:AjaxUpdatedControl ControlID="rgPersonList" LoadingPanelID="gridLoadingPanel">
                                    </telerik:AjaxUpdatedControl>
                                </UpdatedControls>
                            </telerik:AjaxSetting>
                        </AjaxSettings>
                    </telerik:RadAjaxManager>
                    <telerik:RadGrid ID="rgPersonList" runat="server" OnNeedDataSource="rgPersonList_NeedDataSource"
                        AutoGenerateColumns="False" AllowPaging="True" AllowCustomPaging="True" AllowSorting="True"
                        ShowStatusBar="True" CellSpacing="0" Culture="zh-CN" GridLines="None" Width="100%"
                        OnItemDataBound="rgPersonList_ItemDataBound">
                        <ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True" EnableRowHoverStyle="true">
                        </ClientSettings>
                        <MasterTableView AutoGenerateColumns="False" NoMasterRecordsText="暂无数据">
                            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                            </ExpandCollapseColumn>
                            <Columns>
                                <%--<telerik:GridTemplateColumn HeaderText="选择" HeaderStyle-Width="50px">
                                    <ItemTemplate>
                                        <input id="ckb" type="checkbox" value='<%#Eval("EmpGuid") %>' runat="server" />
                                    </ItemTemplate>
                                    <HeaderStyle Width="50px"></HeaderStyle>
                                    <ItemStyle Width="50px"></ItemStyle>
                                </telerik:GridTemplateColumn>

                                <telerik:GridTemplateColumn HeaderText="" HeaderStyle-Width="5px">
                                    <ItemTemplate>
                                        &nbsp;
                                    </ItemTemplate>
                                    <ItemStyle Width="5px"></ItemStyle>
                                </telerik:GridTemplateColumn>--%>

                                <telerik:GridBoundColumn DataField="EmpGuid" DataType="System.String" HeaderText="EmpGuid"
                                    UniqueName="EmpGuid" Visible="false">
                                </telerik:GridBoundColumn>
                               
                                <telerik:GridTemplateColumn HeaderText="姓名" SortExpression="Name">
                                    <ItemTemplate>
                                        <%#Eval("Name") %>
                                    </ItemTemplate>
                                    <ItemStyle Width="70px"></ItemStyle>
                                </telerik:GridTemplateColumn>
                                 <%--<telerik:GridBoundColumn DataField="corpName" DataType="System.String" HeaderText="企业名称"
                                    SortExpression="corpName">
                                </telerik:GridBoundColumn>--%>

                                <%--<telerik:GridTemplateColumn HeaderText="企业名称" SortExpression="CorpName">
                                    <ItemTemplate>
                                        <%#Eval("corpName")%>
                                    </ItemTemplate>
                                    <ItemStyle Width="200px"></ItemStyle>
                                </telerik:GridTemplateColumn>--%>

                                <telerik:GridCalculatedColumn SortExpression="IDType" HeaderText="证件类型" DataFields="IDType"
                                    Expression='{0}=="1"?"身份证":"其他"' FooterText="CalculatedColumn footer" HeaderStyle-HorizontalAlign="Center"
                                    Visible="False">
                                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                    <ItemStyle Width="60px" HorizontalAlign="Center"></ItemStyle>
                                </telerik:GridCalculatedColumn>
                                <telerik:GridBoundColumn DataField="IDCard" DataType="System.String" HeaderText="证件号"
                                      SortExpression="IDCard" UniqueName="IDCard">
                                    <ItemStyle Width="85px"></ItemStyle>
                                </telerik:GridBoundColumn>
                                <telerik:GridCalculatedColumn SortExpression="Sex" HeaderText="&nbsp;&nbsp;&nbsp;&nbsp;性别" DataFields="Sex"
                                    Expression='{0}==1?"男":"女"' FooterText="CalculatedColumn footer" >
                                    <ItemStyle Width="60px" HorizontalAlign="Center"></ItemStyle>
                                </telerik:GridCalculatedColumn>
                            
                                <telerik:GridBoundColumn DataField="TypeFlag" DataType="System.String" Visible="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn HeaderText="锁定" SortExpression="isZZEmp" Visible="false">
                                    <ItemTemplate>
                                            <%#Eval("isZZEmp")!=null && Eval("isZZEmp").ToString()=="1"?"锁定":""%>
                                    </ItemTemplate>
                                    <ItemStyle Width="65px"></ItemStyle>
                                </telerik:GridTemplateColumn>

                                <telerik:GridBoundColumn DataField="ZCJZSStr" DataType="System.String" HeaderText="注册建造师"
                                      SortExpression="ZCJZSStr" UniqueName="ZCJZSStr">
                                    <ItemStyle Width="150px"></ItemStyle>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn DataField="ZCStr" DataType="System.String" HeaderText="职称"
                                      SortExpression="ZCStr" UniqueName="ZCStr">
                                    <ItemStyle Width="150px"></ItemStyle>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn DataField="GJGWStr" DataType="System.String" HeaderText="关键岗位"
                                      SortExpression="GJGWStr" UniqueName="GJGWStr">
                                    <ItemStyle Width="150px"></ItemStyle>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn DataField="JZYJSStr" DataType="System.String" HeaderText="建筑业技师"
                                      SortExpression="JZYJSStr" UniqueName="JZYJSStr">
                                    <ItemStyle Width="150px"></ItemStyle>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn DataField="ZYJNStr" DataType="System.String" HeaderText="职业技能"
                                      SortExpression="ZYJNStr" UniqueName="ZYJNStr">
                                    <ItemStyle Width="150px"></ItemStyle>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn DataField="SafeStr" DataType="System.String" HeaderText="安全生产"
                                      SortExpression="SafeStr" UniqueName="SafeStr">
                                    <ItemStyle Width="150px"></ItemStyle>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn DataField="TZZYStr" DataType="System.String" HeaderText="特种作业"
                                      SortExpression="TZZYStr" UniqueName="TZZYStr">
                                    <ItemStyle Width="150px"></ItemStyle>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn DataField="QTJSStr" DataType="System.String" HeaderText="其他技术"
                                      SortExpression="QTJSStr" UniqueName="QTJSStr">
                                    <ItemStyle Width="150px"></ItemStyle>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn DataField="EmployeeType" DataType="System.String" Visible="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn>
                                    <ItemTemplate>
                                    <%#GetRepeateButton(Convert.ToInt32(Eval("EmployeeType")),Eval("IDCard").ToString())%>
                                        <%--<input id="btnViewRepeat" type="button" value="点击查看重复" style="border: 1"
                                            onclick="ViewRepeatList('<%#Eval(IDCard) %>')" />--%>
                                    </ItemTemplate>
                                    <ItemStyle Width="65px"></ItemStyle>
                                </telerik:GridTemplateColumn>
                            </Columns>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                            <PagerStyle AlwaysVisible="True"></PagerStyle>
                        </MasterTableView>
                        <PagerStyle AlwaysVisible="True" />
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>
                    <!--[if lte IE 6]> </div> <![endif]-->
                </div>
            </td>
            <td class="right_con">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="con_m tt_left_bottom">&nbsp;</td>
            <td colspan="2" class="con_m">&nbsp;</td>
            <td class="tt_right_bottom">&nbsp;</td>
        </tr>
    </table>
    <telerik:RadAjaxLoadingPanel runat="server" ID="gridLoadingPanel">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"
        Skin="WebBlue">
    </telerik:RadWindowManager>
</asp:Content>